﻿<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

<tiles:insertTemplate template="LayoutAdmin.jsp">
	<tiles:putAttribute name="body">
	
		<!-- LEFT -->
		<div class="art-layout-cell art-content clearfix">
			<div class="art-block clearfix">
				
				<div class="art-blockcontent">
					Status: <h4 style="color: red">${error}</h4>
					<form action="crudCategory.do" method="post">
						<p>Id: <input name="txtId" value="${entityCategory.id}" readonly="readonly"></p>
						<p>Name: <input name="txtName" value="${entityCategory.name}" required></p>
						<p>Note: <input name="txtNote" value="${entityCategory.note}" required></p>
						<input type="submit" name="btnCreate" value="Create" class="art-button">
						<input type="submit" name="btnUpdate" value="Update" class="art-button">
						<input type="submit" name="btnDelete" value="Delete" class="art-button">
						<input type="submit" name="btnRefresh" value="Refresh" class="art-button">
					</form>
					
					<h1>DANH SÁCH DANH MỤC SẢN PHẨM</h1>
					
					<table class="art-article" width="80%">
						<tbody>
							<tr style="background-color: #42BEEB">
								<th>Id</th>
								<th>Name</th>
								<th>Note:</th>
								<th>&nbsp;</th>
							</tr>
							
							<c:forEach var="c" items="${showCategory}">
								<tr>
									<td>${c.id}</td>
									<td>${c.name}</td>
									<td>${c.note}</td>
									
									<td><a href="crudCategory.do?categoryId=${c.id}">Chi tiết</a></td>
								</tr>
							</c:forEach>
														
						</tbody>
					</table>
				</div>
			</div>
			
		</div>
		<!-- END LEFT -->
	
		<!-- RIGHT -->
		<div class="art-layout-cell art-sidebar1 clearfix">
			<!-- SEACH -->
			<div class="art-block clearfix">
			    <div class="art-blockheader">
			        <h3 class="t">Search</h3>
			    </div>
			    <!-- END TIEU DE -->
			    <div class="art-blockcontent">
				    <div>
						<form action="#" class="art-search" method="get" name="searchform" autocomplete="on">
						  	<input type="text" value="" name="s">
						  	<input type="submit" value="" name="search" class="art-search-button">
						</form>
					</div>
				</div>
			</div>
			<!-- END SEACH -->
			
			<!-- CATEGORY -->
			<div class="art-block clearfix">
			    <div class="art-blockheader">
			        <h3 class="t">Categories</h3>
			    </div>
				<div class="art-blockcontent">
					<div>
						<ul>
							<li>
							  <a href="#" title="All News">All News</a> (50)
							</li>
						</ul>
					</div>
				</div>
			</div>
			
			<!-- END CATEGORY -->
		
		</div>
		<!-- END RIGHT -->
	</tiles:putAttribute>
</tiles:insertTemplate>